home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / Graphic Elements 3 / GEQTHack / GEAbout.c next >
Text File  |  1995-06-11  |  1KB  |  63 lines

  1. /*
  2.     GEAbout.c
  3.     
  4.     Graphic Elements © 1994 About Box
  5.     
  6.     Copyright 1995 by Al Evans. All rights reserved.
  7.     
  8.     6/11/95
  9.     
  10. */
  11.  
  12. #include "GEAbout.h"
  13. #include "SFXCtrlr.h"
  14. #include "SFXProcs.h"
  15. #include "SFXDissolve.h"
  16.  
  17. // Stuff for fade-in/fade-out about box
  18.  
  19. pascal Boolean AboutSensorTrack(GEWorldPtr world, GrafElPtr sensor)
  20. {
  21.     while (StillDown()) 
  22.         DoWorldUpdate(world, false);
  23.  
  24.     if (sensor->actionProc != nil)
  25.         (sensor->actionProc)(world, sensor, 0);
  26.     return true;
  27. }
  28.  
  29. void TakeDownAboutBox(GEWorldPtr world);
  30.  
  31. pascal void AboutSensorAction(GEWorldPtr world, GrafElPtr sensor, short sensorState)
  32. {
  33.     TakeDownAboutBox(world);
  34. }
  35.  
  36. void PutUpAboutBox(GEWorldPtr world)
  37. {
  38.     GrafElPtr    abtBox = nil;
  39.     GrafElPtr    faderGE = nil;
  40.     
  41.     abtBox = NewBasicPICT(world, aboutBoxID, aboutBoxPlane, rAboutBox, transparent, 185, 119);
  42.     if (abtBox != nil) {
  43.         abtBox->trackingProc = AboutSensorTrack;
  44.         abtBox->actionProc = AboutSensorAction;
  45.         abtBox->sensorState = 0;
  46.         AddSensorToList(world, aboutBoxID, &abtBox->animationRect);
  47.         faderGE = DoGESFX(world, 'SFX ', abtBox, SFXDissolve, geDissolveSteps, 0, 60, true, true);
  48.     }
  49.     
  50. }
  51.  
  52. void TakeDownAboutBox(GEWorldPtr world)
  53. {
  54.     GrafElPtr    abtBox = nil;
  55.     GrafElPtr    faderGE = nil;
  56.     abtBox = FindElementByID(world, aboutBoxID);
  57.     if (abtBox != nil) {
  58.         faderGE = DoGESFX(world, 'SFX ', abtBox, SFXDissolve, geDissolveSteps, 0, 60, false, true);
  59.         DisposeGrafElement(world, aboutBoxID);
  60.     }
  61. }
  62.  
  63.